﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace ProductSystem.BLL.Common
{
    public class TBConfig
    {
        private static object locker = new object();
        private static TBConfig instance;

        public static TBConfig Instance()
        {
            if (null == instance)
            {
                lock (locker)
                {
                    if (null == instance)
                    {
                        instance = new TBConfig();
                    }
                }
            }
            return instance;
        }

        /// <summary>
        /// 管理登录地址
        /// </summary>
        /// <returns></returns>
        public string ManageLoginUrl()
        {
            return ConfigurationManager.AppSettings["ManageLoginUrl"];
        }
        public string ManageTimeOutUrl()
        {
            return ConfigurationManager.AppSettings["ManageTimeOutUrl"];
        }
        public string ManageNoRoleUrl()
        {
            return ConfigurationManager.AppSettings["ManageNoRoleUrl"];
        }

        #region 提示信息

        /// <summary>
        /// 添加成功提示信息
        /// </summary>
        public string GetPromptAddSuccess
        {
            get { return "添加成功！"; }
        }

        /// <summary>
        /// 添加失败提示信息
        /// </summary>
        public string GetPromptAddFail
        {
            get { return "添加失败！"; }
        }

        /// <summary>
        /// 添加时，已存在相同数据的提示信息
        /// </summary>
        public string GetPromptAddExist
        {
            get { return "添加失败，已有该数据的存在！"; }
        }

        /// <summary>
        /// 复制成功
        /// </summary>
        public string GetPromptCopySuccess
        {
            get { return "复制成功！"; }
        }

        /// <summary>
        /// 复制失败
        /// </summary>
        public string GetPromptCopyFail
        {
            get { return "复制失败！"; }
        }

        /// <summary>
        /// 复制失败,没有数据源
        /// </summary>
        public string GetPromptCopyNone
        {
            get { return "复制失败,没有数据源！"; }
        }

        /// <summary>
        /// 操作成功
        /// </summary>
        public string GetPromptSuccess
        {
            get { return "操作成功！"; }
        }

        /// <summary>
        /// 操作失败
        /// </summary>
        public string GetPromptFail
        {
            get { return "操作失败！"; }
        }

        /// <summary>
        /// 删除失败的提示信息
        /// </summary>
        public string GetPromptDeleteFail
        {
            get { return "删除失败！"; }
        }

        /// <summary>
        /// 删除成功的提示信息
        /// </summary>
        public string GetPromptDeleteSuccess
        {
            get { return "删除成功！"; }
        }

        /// <summary>
        /// 编辑成功的提示信息
        /// </summary>
        public string GetPromptEditSuccess
        {
            get { return "编辑成功！"; }
        }

        /// <summary>
        /// 编辑失败的提示信息
        /// </summary>
        public string GetPromptEditFail
        {
            get { return "编辑失败！"; }
        }

        /// <summary>
        /// 保存成功的提示信息
        /// </summary>
        public string GetPromptSaveSuccess
        {
            get { return "保存成功！"; }
        }

        /// <summary>
        /// 保存失败的提示信息
        /// </summary>
        public string GetPromptSaveFail
        {
            get { return "保存失败！"; }
        }

        /// <summary>
        /// 回补成功的提示信息
        /// </summary>
        public string GetPromptCoverSuccess
        {
            get { return "回补成功！"; }
        }

        /// <summary>
        /// 回补失败的提示信息
        /// </summary>
        public string GetPromptCoverFail
        {
            get { return "回补失败！"; }
        }
        /// <summary>
        /// 纠正数据成功的提示信息
        /// </summary>
        public string GetPromptCorrectSuccess
        {
            get { return "纠正成功！"; }
        }
        /// <summary>
        /// 纠正数据失败的提示信息
        /// </summary>
        public string GetPromptCorrectFail
        {
            get { return "纠正失败！"; }
        }

        /// <summary>
        /// 编辑时，已存在相同数据的提示信息
        /// </summary>
        public string GetPromptEditExist
        {
            get { return "编辑失败,已有该数据存在！"; }
        }

        public string GetPromptUploadSuccess
        {
            get { return "上传成功！"; }
        }

        public string GetPromptUploadFail
        {
            get { return "上传失败！"; }
        }
        /// <summary>
        /// 存在上报信息的提示信息
        /// </summary>
        public string GetIsExistReportedInfo
        {
            get { return "已存在上报信息！"; }
        }
        public string GetNoExistCityPublish
        {
            get { return "没有可用于上报的发布数据"; }
        }
        /// <summary>
        /// 发布成功的提示信息
        /// </summary>
        public string GetPromptPublishSuccess
        {
            get { return "发布成功！"; }
        }

        /// <summary>
        /// 发布失败的提示信息
        /// </summary>
        public string GetPromptPublishFail
        {
            get { return "发布失败！"; }
        }

        /// <summary>
        /// 请先审核数据的提示信息
        /// </summary>
        public string GetPromptCityAuditMis
        {
            get { return "请先审核数据！"; }
        }

        /// <summary>
        /// 预报成功的提示信息
        /// </summary>
        public string GetPromptForecastSuccess
        {
            get { return "预报成功！"; }
        }

        /// <summary>
        /// 预报失败的提示信息
        /// </summary>
        public string GetPromptForecastFail
        {
            get { return "预报失败！"; }
        }

        /// <summary>
        /// 请先预报站点数据的提示信息
        /// </summary>
        public string GetPromptForecastStationDataMis
        {
            get { return "请先预报站点数据！"; }
        }

        /// <summary>
        /// 添加成功提示信息
        /// </summary>
        public string GetPromptAuditSuccess
        {
            get { return "审核成功！"; }
        }

        /// <summary>
        /// 添加失败提示信息
        /// </summary>
        public string GetPromptAuditFail
        {
            get { return "审核失败！"; }
        }

        #endregion
        #region 其他
        #region 时间格式
        public string DayDateTimeFormat
        {
            get { return "yyyy-MM-dd"; }
        }

        public string DayDateTimeCNFormat
        {
            get { return "yyyy年M月d日"; }
        }

        public string HourDateTimeFormat
        {
            get { return "yyyy-MM-dd HH:00"; }
        }

        public string HourDateTimeCNFormat
        {
            get { return "yyyy年M月d日H时"; }
        }

        public string MinuteDateTimeFormat
        {
            get { return "yyyy-MM-dd HH:mm"; }
        }
        #endregion
        public Dictionary<bool, string> StatusDic = new Dictionary<bool, string>(){
            {true,"开启"},
            {false,"关闭"}
        };
        #endregion
        #region 气象相关
        /// <summary>
        /// 天气图标
        /// </summary>
        public Dictionary<string, string> WeatherIcon
        {
            get
            {
                return new Dictionary<string, string>() 
                {
                    {"晴","01"},
                    {"多云","02"},
                    {"阴","03"},
                    {"阵雨","04"},
                    {"雷阵雨","05"},
                    {"小雨","06"},
                    {"小到中雨","07"},
                    {"中雨","08"},
                    {"中到大雨","09"},
                    {"大雨","10"},
                    {"大到暴雨","11"},
                    {"暴雨","12"},
                    {"大暴雨","13"},
                    {"特大暴雨","14"},
                    {"霾","15"},
                    {"灰霾",""},
                    {"雾","16"},
                    {"雨夹雪","17"},
                    {"小雪","18"},
                    {"中雪","19"},
                    {"大雪","20"},
                    {"暴雨到大暴雨","21"},
                    {"9999",""},
                    {"",""}
                };
            }
        }

        #region 气象数据抓取
        /// <summary>
        /// 气象数据抓取Type_Code
        /// </summary>
        public string MeteorologyData
        {
            get { return "MeteorologyData"; }
        }
        /// <summary>
        /// 气象小时数据
        /// </summary>
        public string MetHourMonData
        {
            get { return "2002"; }
        }
        /// <summary>
        /// 气象日均数据
        /// </summary>
        public string MetDayMonData
        {
            get { return "2003"; }
        }
        /// <summary>
        /// 7天天气预报
        /// </summary>
        public string MetDayForeData
        {
            get { return "2004"; }
        }
        /// <summary>
        /// 精细预报
        /// </summary>
        public string MetHourForeData
        {
            get { return "2005"; }
        }
        /// <summary>
        /// 气象预报数据
        /// </summary>
        public string MetForecastData
        {
            get { return "2006"; }
        }

        /// <summary>
        /// 全国联网城市污染物预报数据
        /// </summary>
        public string MetCityPollutantForecast
        {
            get { return "2007"; }
        }


        /// <summary>
        /// 全国联网省份污染物预报数据
        /// </summary>
        public string MetProvincePollutantForecast
        {
            get { return "2008"; }
        }


        #endregion
        #region 数据回补状态
        /// <summary>
        /// 回补信息状态Type_Code
        /// </summary>
        public string MissDataStatus
        {
            get { return "MissDataStatus"; }
        }
        /// <summary>
        /// 回补过期
        /// </summary>
        public string CoverOverdue
        {
            get { return "3004"; }
        }
        /// <summary>
        /// 已回补
        /// </summary>
        public string CoverDone
        {
            get { return "3003"; }
        }
        /// <summary>
        /// 回补中
        /// </summary>
        public string CoverDoing
        {
            get { return "3002"; }
        }
        /// <summary>
        /// 未回补
        /// </summary>
        public string CoverUndone
        {
            get { return "3001"; }
        }
        #endregion
        #region 预测/后向轨迹
        /// <summary>
        /// 未生成
        /// </summary>
        public string ToProduce
        {
            get { return "5001"; }
        }
        /// <summary>
        /// 已生成
        /// </summary>
        public string Produced
        {
            get { return "5002"; }
        }
        /// <summary>
        /// 已下载
        /// </summary>
        public string Downloaded
        {
            get { return "5003"; }
        }
        /// <summary>
        /// 预测轨迹ImageTypeCode
        /// </summary>
        public string ForwardTrajectory
        {
            get { return "1013"; }
        }
        /// <summary>
        /// 后向轨迹ImageTypeCode
        /// </summary>
        public string BackwardTrajectory
        {
            get { return "1014"; }
        }
        #endregion
        #endregion
    }
}
